package com.yisu.expressway.manager.core.mapper;

import com.yisu.expressway.ewf.entity.GoodsArchives;
import com.yisu.expressway.manager.domain.request.GoodsArchivesRequest;
import com.yisu.expressway.manager.domain.request.SalesGoodsRequest;
import com.yisu.expressway.manager.domain.vo.RecommendGoodsForSelVo;
import com.yisu.expressway.manager.domain.vo.SalesGoodsVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsArchivesMapper {
    int deleteByPrimaryKey(Long goodsNo);

    int resetInfo();

    int insert(GoodsArchives record);

    GoodsArchives selectByPrimaryKey(Long goodsNo);

    int updateByPrimaryKeyWithBLOBs(GoodsArchives record);

    int updateByPrimaryKey(GoodsArchives record);

    List<GoodsArchives> getGoodsArchivesByCategoryCodeByPage(GoodsArchivesRequest goodsArchivesRequest);

    List<RecommendGoodsForSelVo> selectGoodsArchivesForAllByPage(GoodsArchivesRequest goodsArchivesRequest);

    int getMaxSortByCategoryCode(@Param("categoryCode")String categoryCode);

    /**
     * 编辑商品排序
     * @param goodsArchivesRequest 需要排序的商品信息
     * @return 成功失败
     */
    int updateCategoryGoodsSort(GoodsArchivesRequest goodsArchivesRequest);
    /**
     * 编辑商品状态
     * @param goodsArchivesRequest  参数信息
     * @return 成功失败
     */
    int updateStatus(GoodsArchivesRequest goodsArchivesRequest);

    /**
     * 获取当前类目下所有类目商品，包含子分类
     * @param goodsArchivesRequest 请求信息
     * @return 类目商品列表
     */
    List<RecommendGoodsForSelVo> getGoodsArchivesByParentCategoryCodeForAllByPage(GoodsArchivesRequest goodsArchivesRequest);

    /**
     * 通过分类获取分类推荐商品列表
     * @param categoryCode 分类编号
     * @return 分类列表
     */
    List<RecommendGoodsForSelVo> getRecommendGoodsGoodsArchivesByCategoryCode(@Param("categoryCode")String  categoryCode);

    /**
     * 获取售卖商品列表
     * @param salesGoodsRequest 请求信息
     * @return 商品列表
     */
    List<SalesGoodsVo> getSalesGoodsListByPage(SalesGoodsRequest salesGoodsRequest);


    /**
     * 获取所有商品档案信息
     * @return
     */
    List<GoodsArchives> getAllGoodsData();

    /**
     * 更新商品档案图片信息
     * @param goodsArchives
     * @return
     */
    boolean updateImageInfo(GoodsArchives goodsArchives);

}